package com.share.common.utils;

////System.getenv获取环境变量,仅idea重启才有效
public class EnvUtil {
    public final static String JAVA_HOME = System.getenv("JAVA_HOME");
    public final static String MAVEN_HOME = System.getenv("MAVEN_HOME");
    public final static String USER_HOME = System.getProperty("user.home"); //C:\Users\Administrator
    public final static String USER_NAME = System.getProperty("user.name"); //Administrator
    public final static String OS_NAME = System.getProperty("os.name");  // 操作系统名称 Windows 10
    public final static String USER_DIR = System.getProperty("user.dir"); //工程主目录

    public static void main(String[] args) {
        System.out.println(USER_DIR);

        System.out.println(JAVA_HOME);
        System.out.println(MAVEN_HOME);
        System.out.println(USER_HOME);
        System.out.println(USER_NAME);
        System.out.println(OS_NAME);
    }
}
